<template>
  <a-modal
    :title="$t('详情')"
    :width="width"
    :visible="visible"
    @cancel="handleCancel"
    class="customHeight customHeightChild modal_title"
    v-drag
  >
    <template slot="footer">
      <a-button @click="handleCancel">{{ $t('取消') }}</a-button>
    </template>
    <div>
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item :label="$t('门票名称')">
                <a-input v-model="queryParam.goodsName" :placeholder="$t('请输入门票名称')" />
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                <a-button type="primary" @click="searchQuery" icon="search">{{ $t('查询') }}</a-button>
                <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{
                  $t('重置')
                }}</a-button>
                <a-button
                v-has="'BisMemberTicketController:export'"
                type="primary"
                icon="download" :loading="exloading"
                style="margin-left: 8px"
                @click="handleExportXls($t('门票汇总'))"
                >{{$t('导出')}}</a-button
              >
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>
      <div>
        <a-table
          ref="table"
          size="middle"
          :scroll="{x:true}"
          bordered
          rowKey="id"
          :columns="columns"
          :dataSource="dataSource"
          :pagination="ipagination"
          :loading="loading"
          class="j-table-force-nowrap"
          @change="handleTableChange"
        >
        </a-table>
      </div>
    </div>
  </a-modal>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil'
import moment from 'moment'
export default {
  name: 'MemberTicketValidTotalModal',
  mixins: [JeecgListMixin],
  data() {
    return {
      moment,
      width: 1200,
      visible: false,
      columns: [
        {
          title: this.$t('门票名称'),
          align: 'center',
          dataIndex: 'goodsName',
        },
        {
          title: this.$t('总张数'),
          align: 'center',
          dataIndex: 'count',
        },
        {
          title: this.$t('总有效次数'),
          align: 'center',
          dataIndex: 'totalNumber',
          customRender:(t,r)=>{
            if(r.totalNumber=='0'){
              return this.$t('不限次')
            }
            return t
          }
        },
        {
          title: this.$t('剩余有效次数'),
          align: 'center',
          dataIndex: 'remainNumber',
          customRender:(t,r)=>{
            if(r.totalNumber=='0'){
              return this.$t('不限次')
            }
            return t
          }
        }
      ],
      url: {
        list: '/member/bisMemberTicket/validTotal',
        exportXlsUrl: '/member/bisMemberTicket/validTotalExportXls',
      },
      isCustom: true,
      model: {},
      stateList:[]
    }
  },
  created() {
  },
  methods: {
    show() {
      this.visible = true
      this.loadData(1)
    },
    handleCancel() {
      this.visible = false
    },
  },
}
</script>